<template>
  <div class="box">
    <div class="header">股东及出资信息</div>
    <div class="topBar">
      <div class="topBox">
        <div>
          <el-form
            ref="headerSearchForm"
            :model="headerSearchForm"
            :inline="true"
          >
            <el-form-item label="股东名称" prop="customerName">
              <el-input
                v-model="headerSearchForm.customerName"
                placeholder="请输入"
              >
              </el-input>
            </el-form-item>
            <el-form-item label="股东类型" prop="customerType">
              <el-select
                v-model="headerSearchForm.customerType"
                placeholder="请选择"
                size="mini"
                clearable
              >
                <el-option
                  v-for="(item, index) in shareholderType"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="出资形式" prop="customerPly">
              <el-select
                v-model="headerSearchForm.customerPly"
                placeholder="请选择"
                size="mini"
                clearable
              >
                <el-option
                  v-for="(item, index) in customerPlyData"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item style="float: right; overflow: hidden">
              <el-button type="primary" class="btn">查询</el-button>
              <el-button type="primary" class="btn">重置</el-button>
            </el-form-item>
          </el-form>
          <div>
            <el-row>
              <el-col :span="16" style="text-align: left">
                <el-button type="primary" class="btn" @click="add"
                  >新增</el-button
                >
                <el-button type="primary" class="btn">导出</el-button>
              </el-col>
            </el-row>
          </div>
        </div>
      </div>
    </div>
    <div class="right">
      <div class="tableBox">
        <el-table :data="tableData" class="tableBoxChild">
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column label="序号" align="center" type="index">
          </el-table-column>
          <el-table-column
            prop="shareholderName"
            label="股东名称"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="subscriptionAmount"
            label="认缴金额"
            align="center"
          >
          </el-table-column>
          <el-table-column prop="unit" label="单位" align="center">
          </el-table-column>
          <el-table-column
            prop="contributiveTime"
            label="出资时间"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="shareholdingRatio"
            label="持股比例"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="shareholderType"
            label="股东类型"
            align="center"
          >
          </el-table-column>
          <el-table-column prop="contributive" label="出资形式" align="center">
          </el-table-column>
          <el-table-column prop="turnoverTime" label="更新时间" align="center">
          </el-table-column>
          <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <span @click="edit" class="operator">编辑</span>
              <span class="operator">删除</span>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          layout="prev, pager, next"
          :total="total"
          @current-change="pageFn"
        >
        </el-pagination>
      </div>
    </div>
    <!-- 新增编辑弹框 -->
    <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      :append-to-body="true"
      destroy-on-close
      width="700px"
    >
      <el-form ref="dealMajorForm" :model="dealMajorForm" label-width="180px">
        <el-form-item label="股东名称" prop="srcSystemCode">
          <el-input v-model="dealMajorForm.srcSystemCode" placeholder="请输入">
          </el-input>
        </el-form-item>
        <el-form-item label="认缴金额/持股数(数值)" prop="srcSystemCode">
          <el-input v-model="dealMajorForm.srcSystemCode" placeholder="请输入">
          </el-input>
        </el-form-item>
        <el-form-item label="单位" prop="srcSystemCode">
          <el-input v-model="dealMajorForm.srcSystemCode" placeholder="请输入">
          </el-input>
        </el-form-item>
        <el-form-item label="出资日期" prop="srcSystemCode">
          <el-date-picker
            v-model="dealMajorForm.srcSystemCode"
            type="date"
            placeholder="选择日期"
            value-format="yyyy-MM-dd"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="持股比例" prop="srcSystemCode">
          <el-input v-model="dealMajorForm.srcSystemCode" placeholder="请输入">
          </el-input>
        </el-form-item>
        <el-form-item label="股东类型" prop="dataBatchDate">
          <el-select
            v-model="dealMajorForm.tradeStatus"
            placeholder="请选择"
            size="mini"
            clearable
          >
            <el-option
              v-for="(item, index) in dealStatus"
              :key="index"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="出资形式" prop="srcBizCode">
          <el-select
            v-model="dealMajorForm.tradeStatus"
            placeholder="请选择"
            size="mini"
            clearable
          >
            <el-option
              v-for="(item, index) in dealStatus"
              :key="index"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false" class="btn">取 消</el-button>
        <el-button type="primary" @click="handleOk" class="gray-btn"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible: false,
      dealStatus: [],
      dealMajorForm: {
        tradeId: '', //交易ID
        tradeVersion: '', // 交易版本号
        tradeStatus: '', //交易状态
        dataBatchDate: '', //数据批次日期
        srcSystemCode: '', //源系统名称
        srcBizCode: '', // 源系统编号
        // TRADETYPE: '', //summit55交易类型
        // TRADEID: '', //summit55交易ID
        productName: '', //产品代码
        tradeType: '', //交易类型
        subTradeType: '', //子交易类型
        bookName: '', //投资组合
        cptFullCnnm: '', //交易对手
        tradePurpose: '', //交易目的说明
        tradeDate: '', //交易日期
        tradeTime: '', //交易时间
        inputDate: '', //录入日期
        traderId: '', //交易员
        dealDir: '', //交易方向
        notional: '', //名义本金
        tradeAmount: '', //交易金额(买入)
        tradeAmount2: '', //交易金额卖出
        valueDate: '', //起息日期
        maturityDate: '', //到期日期
        settleDate: '', //结算日期
        settleDate2: '', //到期结算日期
        isMirrorFlag: '', //是否内部交易
        isClienttradeFlag: '', //是否客户交易
        netcreditFlag: '', //信用额度是否轧差:
        dataQualityType: '', //数据质量
        tradeFlag1: '', //交易标签1
        tradeFlag2: '', //交易标签2
        comment1: '', //交易备注1
        comment2: '', //交易备注2
        tradeDesc: '', //交易描述
        settleStatus: '', //结算状态
      },
      tableData: [
        {
          shareholderName: '中国长江电力股份有限公司',
          subscriptionAmount: '5000219.54972',
          unit: '万元',
          contributiveTime: '2004-9-17',
          shareholdingRatio: '20',
          shareholderType: '',
          contributive: '货币',
          turnoverTime: '2016-6-2',
        },
        {
          shareholderName: '中国宝武钢铁集团有限公司',
          subscriptionAmount: '5000219.54972',
          unit: '万元',
          contributiveTime: '2004-9-17',
          shareholdingRatio: '20',
          shareholderType: '',
          contributive: '货币',
          turnoverTime: '2016-6-2',
        },
        {
          shareholderName: '中国建银投资有限责任公司',
          subscriptionAmount: '5000219.54972',
          unit: '万元',
          contributiveTime: '2004-9-17',
          shareholdingRatio: '20',
          shareholderType: '',
          contributive: '货币',
          turnoverTime: '2016-6-2',
        },
        {
          shareholderName: '国家电网有限公司',
          subscriptionAmount: '5000219.54972',
          unit: '万元',
          contributiveTime: '2004-9-17',
          shareholdingRatio: '20',
          shareholderType: '',
          contributive: '货币',
          turnoverTime: '2016-6-2',
        },
        {
          shareholderName: '中央汇金投资有限责任公司',
          subscriptionAmount: '5000219.54972',
          unit: '万元',
          contributiveTime: '2004-9-17',
          shareholdingRatio: '20',
          shareholderType: '',
          contributive: '货币',
          turnoverTime: '2016-6-2',
        },
      ],
      headerSearchForm: {
        customerName: '',
        customerType: '',
        customerPly: '',
        customerSubType: '',
      },
      total: 10,
      shareholderType: [],
      typeSubData: [],
      customerPlyData: [
        {
          label: '战略',
          value: 'strategy',
        },
        {
          label: '重要',
          value: 'significance',
        },
        {
          label: '长尾',
          value: 'longTail',
        },
      ],
      title: '',
    };
  },
  mounted() {},
  methods: {
    add() {
      this.title = '新增';
      this.dialogVisible = true;
    },
    edit() {
      this.title = '编辑';
      this.dialogVisible = true;
    },
    handleOk() {
      this.dialogVisible = false;
    },
    toCustomerView() {
      this.$router.replace('/customerManagement/customerView');
    },
    pageFn() {},
  },
};
</script>
<style lang="scss" scoped>
.el-table ::v-deep th.el-table__cell {
  background-color: #1c2238 !important;
  color: #fff;
}

.box {
  height: calc(100vh - 160px);
  overflow: scroll;
  .header {
    background: #354060;
    line-height: 50px;
    padding-left: 20px;
    font-size: 16px;
    font-weight: 700;
  }
  .topBar {
    min-height: 80px;
    background-color: #262d47;
    padding: 20px;
    padding-left: 16px;
    padding-bottom: 0px;
  }

  .topBox {
    span {
      display: inline-block;
    }

    .searchBtn {
      margin-left: 20px;
    }

    .zj {
      margin-left: 20px;
    }

    .khTitle {
      height: 30px;
      line-height: 30px;
      vertical-align: top;
      color: #ffffff;
      font-size: 14px;
      font-weight: 700px;
      margin-right: 10px;
    }

    .khInput,
    .zjInput {
      height: 30px;
      line-height: 30px;
      width: 200px;
      overflow: hidden;
      border: 1px solid rgba(126, 163, 255, 0.3);
      color: #ffffff;
      background-color: #363657;
      border-radius: 3px;
      cursor: pointer;
      text-align: center;
      line-height: 30px;
      padding: 0px 10px;
      font-size: 12px;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .zjTitle {
      height: 30px;
      line-height: 30px;
      vertical-align: top;
      color: #ffffff;
      font-size: 14px;
      font-weight: 700px;
      margin-right: 10px;
    }
  }

  .left {
    width: 240px;
    background-color: #262d47;
    height: 100%;
  }

  .right {
    flex: 1;
    height: 88%;
    display: flex;
    flex-direction: column;
  }

  .searchList {
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
    height: 700px;
    overflow: scroll;

    .searchListItem {
      height: 35px;
      line-height: 35px;
      text-align: center;
      color: #959fc5;
      font-size: 12px;
      overflow: hidden; //超出隐藏
      white-space: nowrap; //不折行
      text-overflow: ellipsis; //溢出显示省略号
    }

    .searchListItem:hover {
      background: #1f9bfd !important;
      color: #fff;
      cursor: pointer;
    }
  }

  .searchListItemAct {
    background: #1f9bfd !important;
    color: #fff !important;
  }

  .bondCard {
    background-color: #262d47;
    color: #ffffff;
    margin-bottom: 10px;

    .info {
      display: flex;
      padding: 15px 20px;

      .infoItem {
        flex: 1;
      }
    }

    .infoItemLabel {
      margin-right: 30px;
      font-size: 14px;
    }

    .infoItemVal {
      font-size: 14px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #d6dcff;
    }
  }

  .el-table ::v-deep th.el-table__cell {
    background-color: #1c2238 !important;
    color: #fff;
  }

  .tableBox {
    background-color: #262d47;
    flex: 1;
    padding: 15px 10px;
  }

  .tableBoxChild {
    min-height: 500px;
  }

  .el-pagination {
    text-align: right;
  }

  .leftTitle {
    height: 40px;
    line-height: 40px;
    background: #354060;
    font-size: 14px;
    font-family: PingFang-SC-Bold, PingFang-SC;
    font-weight: bold;
    color: #ffffff;
    padding-left: 17px;
    margin-bottom: 10px;
  }

  .customersCardTitle {
    height: 40px;
    background: #354060;
    font-size: 14px;
    font-family: PingFang-SC-Bold, PingFang-SC;
    font-weight: bold;
    color: #ffffff;
    padding: 10px 16px;
  }
}
.operator {
  color: #1f9bfd;
  margin-right: 8px;
  cursor: pointer;
}
::v-deep {
  .el-dialog {
    border-top: 4px solid rgba($color: #1f9bfd, $alpha: 0.9);
    .el-dialog__header {
      border-bottom: 1px solid rgba(126, 163, 255, 0.3);
      padding: 0;
      height: 49px;
      line-height: 49px;
      padding-left: 16px;
    }
    .el-dialog__footer {
      border-top: 1px solid rgba(126, 163, 255, 0.3);
    }
  }
}
</style>
